home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4924 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.2 KB

  1. Path: mail2news.demon.co.uk!ues5.cern.ch
  2. From: Dan Pop <Dan.Pop@cern.ch>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Limit on #bytes inside of struct?
  5. Date: Sun, 11 Feb 1996 21:36:24 +0100
  6. Organization: CERN European Lab for Particle Physics
  7. Message-ID: <9602112036.AA01555@ues5.cern.ch>
  8. References: <4feg1d$d4g@cville-srv.wam.umd.edu> <4ffg6b$ivd@sparcserver.lrz-muenchen.de> <4ffohq$1gb@mordred.gatech.edu> <9602091718.AA18553@ues5.cern.ch> <4fkgns$8t9@sparcserver.lrz-muenchen.de>
  9. X-NNTP-Posting-Host: ues5.cern.ch
  10. X-Newsreader: NN version 6.5.0 #7 (NOV)
  11. X-Mail2News-Path: mail1.cern.ch!ues5.cern.ch
  12.  
  13. watzka@stat.uni-muenchen.de (Kurt Watzka) writes:
  14.  
  15. >Dan Pop <danpop@ues5.cern.ch> writes:
  16. >
  17. >>james@amber.biology.gatech.edu (James McIninch) writes:
  18. >
  19. >>>ua302aa@lrz-muenchen.de wrote:
  20. >>>: jsquires@wam.umd.edu (jeffrey d squires) writes:
  21. >>>
  22. >>>: >Is there a limit on the number of bytes allowed inside of a struct?
  23. >>>
  24. >>>: Yes, there is a limit on the number of bytes allowed in one 
  25. >>>: object. That limit is 32k. 
  26. >>>
  27. >>>No. There is no limit. Individual implementations of compilers or OS's may
  28. >>>impose a limit, but there is no limit that is integral to the C languag itself.
  29. >
  30. >>James is right.  What the C language requires is that a compiler-imposed 
  31. >>limit for the size of an object cannot be lower than 32k.
  32. >
  33. >Yes, James is right, but you still cannot have objects of more than
  34. >32k in a _portable_ C program, so for portable programs there is
  35. >a limit of 32k for the size of an object. You cannot rely on the
  36. >assumption that all compilers will support larger objects.
  37.  
  38. Sorry to disappoint you, but you can't write a _portable_ C program if you
  39. rely exclusively on the standard, which says:
  40.  
  41. 2.2.4.1 Translation limits
  42.  
  43.     The implementation shall be able to translate and execute at least
  44.     one program that contains at least one instance of every one of the
  45.     following limits:
  46.     ...
  47.      * 32767 bytes in an object (in a hosted environment only)
  48.     ...
  49.  
  50. The keywords here are "at least one program".  If your program containing
  51. an object of 32767 bytes (or even less) is not the "one" supported by the
  52. compiler, you're out of luck :-)
  53.  
  54. Dan
  55. -- 
  56. Dan Pop
  57. CERN, CN Division
  58. Email: danpop@mail.cern.ch 
  59. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  60.